package com.wsj.dao;

import java.util.List;

import org.springframework.dao.DataAccessException;

import com.wsj.util.exception.BusinessException;
import com.wsj.util.page.PageResultSet;
import com.wsj.web.subclass.displayBean.HomeSiteNews.AutoPlayFormExtendBean;
import com.wsj.web.subclass.displayBean.HomeSiteNews.HomeSiteNewsExtendBean;
import com.wsj.web.subclass.displayBean.HomeSiteNews.HomeSiteNewsFormExtendBean;
import com.wsj.web.vo.homeSite.AutoPlay;
import com.wsj.web.vo.homeSite.HomeSiteNews;
import com.wsj.web.vo.homeSite.HomeSiteNewsClass;

public interface IHomeSiteNewsDao {
	
	void add(HomeSiteNews homeSiteNews)throws DataAccessException;
	void delete(long id)throws DataAccessException;
	void update(HomeSiteNews homeSiteNews)throws DataAccessException;
	
	HomeSiteNews getHomeSiteNewsById(long id)throws DataAccessException;
	
	HomeSiteNews getHomeSiteNewsByName(Long homeSiteNewsClassid, String title)throws DataAccessException;
	
	
	PageResultSet loadHomeSiteNewsByParam(String keyword,Integer qyId,Integer iscommend,long personalId,String title,
			Integer provId,Integer cityId,Integer diquId,int page,int pageSize,
			long homeSiteNewsClassid ,short isDel,String  content,String  createDatetimeStr)throws DataAccessException;
	PageResultSet loadHomeSiteNewsByExtendBean(HomeSiteNewsFormExtendBean homeSiteNewsFormExtendBean)throws DataAccessException;
	
	public PageResultSet loadByClassId(Long classId,Integer page,Integer pageSize) throws DataAccessException;
	
	/*****
	 * GBX 加 搜索用 
	 * 条件： 标题、内容、关键字 、
	 * 附加条件：已审核、删除否、推荐、时间排序
	 * */  
	public PageResultSet loadNewsByParam(String[] keyword,Integer type,Integer page,Integer pageSize) throws DataAccessException;
	
	/**
	 * 主要用于首页新闻资讯的查询
	 * 基本条件：删除否、推荐、审核
	 * 条件：是否是图片新闻、资讯分类ID、前 top 条
	 * 额外条件： 是否热点 （第一条显示的要是热点）
	 * not in rdNewsId 不在热点内的资讯,null 则不排除
	 * */
	public List getTopByNewsClassId(Short hotspot,Integer isPic,Long newsClassId, Long[] rdNewsId, Integer top) throws DataAccessException;
	
	public List loadTopByHits (Integer top) throws DataAccessException;
	/**
	 * 根据省份ID 、城市ID 栏目ID,加载资讯
	 * */
	public PageResultSet loadByProvOrCityId(Integer qyId,Integer provId, Integer cityId,Long cid, Integer page, Integer pageSize) throws DataAccessException; 
	
	List getTopHSiteNewsListByNewsClassId(long newsClassId, int top)throws DataAccessException;
	List getTopHSiteNByOnlyNewId(long newsClassId, int top)throws DataAccessException;
	List getTopBykeyword(String keyword, Integer top)throws DataAccessException;
	/****
	 * 通过新闻分类,加载文章列表
	 * @param name
	 * @param picOrChar
	 * @param isdel
	 * @param audite
	 * @param isCommend
	 * @param top
	 * @return
	 * @throws DataAccessException
	 */
	List loadNewsByClassNameListDao(String name, Short picOrChar, Short isdel, Short audite, Short isCommend, Integer top)throws DataAccessException;
	
	
	public List getTopByclassId(Short hotspot,Integer provId, Integer top)throws BusinessException;
	
	public List getTopByclassId(Short hotspot,Integer id1,Integer id2,Integer id3,Integer id4, Short isPic, Integer top) throws BusinessException;
	
	HomeSiteNews getTopHSiteNByOrderBytime(long newsClassId, Integer id,Integer top)throws DataAccessException;
	
	/****
	 * 获取分站前几位点击量最大的资讯列表
	 * @param cityId
	 * @param top
	 * @return
	 * @throws DataAccessException
	 */
	List<HomeSiteNews> loadTopByHitsDao(Integer provId,Integer cityId, Integer top)throws DataAccessException;
	/****
	 * 获取分站某个分类下面的资讯列表
	 * @param cityId
	 * @param hotspot
	 * @param isPic
	 * @param newsClassId
	 * @param top
	 * @return
	 * @throws DataAccessException
	 */
	List<HomeSiteNews> loadTopByclassIdDao(Integer provId,Integer cityId, Short hotspot, Integer isPic, Long newsClassId, Integer top)throws DataAccessException;
	
	/*****
	 * 获取分站"市场行情"下面所有子栏目 下面的资讯列表
	 * @param cityId
	 * @param hot
	 * @param pic
	 * @param id
	 * @param index_top_fifteen
	 * @return
	 * @throws DataAccessException
	 */
	List<HomeSiteNews> loadSCHQClassNewsListDao(Integer provId,Integer cityId, Short hot, Short pic, Long id, Integer index_top_fifteen)throws DataAccessException;
	List loadHomeSiteNews(HomeSiteNewsFormExtendBean exbean)throws DataAccessException;
	List loadHomeSiteNewsByProvOrCityAndClassIds(HomeSiteNewsExtendBean homeExtend)throws DataAccessException;
	
	
	/**********
	 * 通过类目id,获取前几条推荐的资讯列表
	 * @param id
	 * @param top
	 * @return
	 * @throws DataAccessException
	 */
	List<HomeSiteNews> getCommendHomeSiteNewsListByClassId(Long id, int top)throws DataAccessException;
	
	
	/**********
	 * 在所有的类目中,查询推荐的资讯列表
	 * @param top
	 * @throws DataAccessException
	 */
	List<HomeSiteNews> getCommendHomeSiteNewsList(int top)throws DataAccessException;
	
	/********
	 * 通过关键字,获取相关的新闻
	 * @param keyWords
	 * @param top5
	 * @return
	 * @throws DataAccessException
	 */
	List<HomeSiteNews> getInterrelatedHomeSiteNewsList(String keyWords, int top5)throws DataAccessException;
	
	
	/************
	 * 在所有类目中获取相关新闻
	 * @param top5
	 * @throws DataAccessException
	 */
	List<HomeSiteNews> getHomeSiteNewsList(int top5)throws DataAccessException;
	
	/**********
	 * 获取引导阅读的新闻,优先查询带图片的新闻,按时间倒序排列
	 * @param hot_news_yes
	 * @param commend_news_yes
	 * @param id
	 * @param top
	 * @return
	 */
	List<HomeSiteNews> getHotCommendNewsListByClassId(Short hot_news_yes, Integer commend_news_yes, Long id, int top)throws DataAccessException;
	
	
	/**********
	 * 获取图片新闻列表
	 * @param hot_news_no
	 * @param commend_news_yes
	 * @param id
	 * @param picNewsNum
	 * @return
	 * @throws DataAccessException
	 */
	List<HomeSiteNews> getTopPicNewsByclassId(Short hot_news_no, Integer commend_news_yes, Long id, int picNewsNum)throws DataAccessException;
	
	/**********
	 * 获取前几条今日推荐新闻列表
	 * @param top
	 * @return
	 * @throws DataAccessException
	 */
	List<HomeSiteNews> getTodayTopTitle(int top)throws DataAccessException;
	
	/******
	 * 获取一周推荐和一月推荐的资讯列表
	 */
	List<HomeSiteNews> getCommentNewsCollectList(long classId, int top)throws DataAccessException;
	
	/*******
	 * 添加自动播放新闻
	 * @param autoPlay
	 * @throws DataAccessException
	 */
	boolean addAutoPlay(AutoPlay autoPlay)throws DataAccessException;
	
	/*******
	 * 通过id,获取自动播放对象
	 * @param id
	 * @return
	 * @throws DataAccessException
	 */
	AutoPlay getAutoPlayById(Integer id)throws DataAccessException;
	
	/********
	 * 更新自动播放新闻
	 * @param autoPlay
	 */
	boolean updateAutoPlay(AutoPlay autoPlay)throws DataAccessException;
	
	/*******
	 * 获取自动播放列表
	 * @param autoPlayFormExtendBean
	 * @return
	 * @throws DataAccessException
	 */
	PageResultSet loadAutoPlayList(AutoPlayFormExtendBean autoPlayFormExtendBean)throws DataAccessException;
	
	
	/******
	 * 删除自动播放对象
	 * @param id
	 * @throws DataAccessException
	 */
	void delAutoPlayById(Integer id)throws DataAccessException;
	
	/*******
	 * 获取自动播放列表
	 * @param top
	 * @return
	 * @throws DataAccessException
	 */
	List<AutoPlay> getAutoPlayNewsList(int top)throws DataAccessException;
	

	
	
	

}
